package com.gzedu.fun.demo.activity;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;

import com.gzedu.R;
import com.gzedu.frame.activity.BaseActivity;
import com.gzedu.frame.logic.JsonBaseLogic;
import com.gzedu.fun.Setting;
import com.gzedu.fun.demo.logic.adapter.DemoAdapter;
import com.gzedu.fun.demo.logic.listener.DemoListener;
import com.gzedu.fun.demo.view.DemoView;

public class DemoActivity extends BaseActivity implements DemoListener {

	private DemoView demoView ;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		demoView = new DemoView(this, R.layout.demo);
		demoView.setListener(this);
		setContentView(demoView);
		JsonBaseLogic json = new JsonBaseLogic(this);
		Map<String, String> map = new HashMap<String, String>();
		map.put("STUD_ID", "a07c611a7f00000122d555b2a8dedda5");
		json.execute(Setting.contactGroupHost, map, "POST");
	}
	
	@Override
	public void onClick(View v) {

	}

	@Override
	public void onItemClick(AdapterView<?> parent, View view, int position,
			long id) {

	}

	@Override
	public void logicFinish(Object result) {
		@SuppressWarnings("unchecked")
		List<Map<String,String>> list=(List<Map<String, String>>) result;
		DemoAdapter demoAdapter=new DemoAdapter(this,list);
		demoView.setAdapter(demoAdapter);
		demoView.setListener(this);
	}

}
